package cn.s1995.sloth.bizs.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import cn.s1995.sloth.bizs.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 订单退款
 *
 * @author Lex
 * @date 2023-12-29 03:07:41
 */
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(description = "订单退款")
@TableName(value = "biz_order_refund", autoResultMap = true)
public class OrderRefund extends BaseEntity {


	/**
	* ID
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "ID")
    private Long id;

	/**
	* 用户id
	*/
    @Schema(description = "用户id")
    private Long uid;

	/**
	* 店铺ID
	*/
    @Schema(description = "店铺ID")
    private Long shopId;

	/**
	* 订单id
	*/
    @Schema(description = "订单id")
    private Long orderId;

	/**
	* 订单项id(全部退款为0)
	*/
    @Schema(description = "订单项id(全部退款为0)")
    private Long orderItemId;

	/**
	* 订单总金额
	*/
    @Schema(description = "订单总金额")
    private BigDecimal orderAmount;

	/**
	* 订单支付方式：1.微信支付 2.支付宝 3.手动代付 4.paypal 5.google 6.apple 7.stripe
	*/
    @Schema(description = "订单支付方式：1.微信支付 2.支付宝 3.手动代付 4.paypal 5.google 6.apple 7.stripe")
    private Integer payMethod;

	/**
	* 订单支付流水号
	*/
    @Schema(description = "订单支付流水号")
    private String flowTradeNo;

	/**
	* 第三方退款单号
	*/
    @Schema(description = "第三方退款单号")
    private String outRefundNo;

	/**
	* 退款状态: 0.退款中 1.退款成功 -1.退款失败
	*/
    @Schema(description = "退款状态: 0.退款中 1.退款成功 -1.退款失败")
    private Integer state;

	/**
	* 处理状态:0.待审核 1.通过 2.拒绝
	*/
    @Schema(description = "处理状态:0.待审核 1.通过 2.拒绝")
    private Integer processState;

	/**
	* 退货数量
	*/
    @Schema(description = "退货数量")
    private Integer num;

	/**
	* 退款金额
	*/
    @Schema(description = "退款金额")
    private BigDecimal amount;

	/**
	* 申请类型:1.仅退款 2.退款退货
	*/
    @Schema(description = "申请类型:1.仅退款 2.退款退货")
    private Integer applyType;

	/**
	* 文件凭证
	*/
    @TableField(typeHandler = com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
    @Schema(description = "文件凭证")
    private List<String> pics;

	/**
	* 申请理由
	*/
    @Schema(description = "申请理由")
    private String reason;

	/**
	* 拒绝理由
	*/
    @Schema(description = "拒绝理由")
    private String rejectReason;

	/**
	* 通过时间
	*/
    @Schema(description = "通过时间")
    private LocalDateTime approvedTime;

	/**
	* 拒绝时间
	*/
    @Schema(description = "拒绝时间")
    private LocalDateTime rejectTime;

	/**
	* 退款时间
	*/
    @Schema(description = "退款时间")
    private LocalDateTime refundTime;
}
